<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>
<body>
    <ul class="box">
        <li class="list">
            <span>我是li中span的元素</span>
            <button id="btn">点击复制li元素</button>
        </li>
    </ul>
    <i></i>
    <script>
        //克隆元素
        var btn = document.querySelector('#btn');
        var box = document.querySelector('.box');
        var list = document.querySelector('.list');
        var i = document.querySelector('i');
        
        console.log(i.hasChildNodes());
        
        btn.onclick = function (){
            var res = list.cloneNode(true);
            box.appendChild(res);
        }
    </script>
</body>
</html>